package Bridge.tow;

/**
 * @ProjectName: 23种设计模式
 * @Package: Bridge.tow
 * @ClassName: Computer
 * @Author: renhan
 * @Description:
 * @Date: 2020/11/24 13:50
 * @Version: 1.0
 */
public abstract class Computer {
    protected Brand brand;

    public Computer(Brand brand){
        this.brand = brand;
    }

    public void info(){
        brand.info();
    }
}

class Desktop extends Computer{
    public Desktop(Brand brand) {
        super(brand);
    }

    public void info() {
        super.info();
        System.out.print("台式机");
    }
}

class Laptop extends Computer{
    public Laptop(Brand brand) {
        super(brand);
    }

    public void info() {
        super.info();
        System.out.print("笔记本");
    }
}